﻿namespace Xmobile.Libs
{
    public class Constants
    {
        /// <summary>
        /// PageCachedContent[Cat:{category}_News:{news}_Page:{page}_DateSearch:{date}]
        /// </summary>
        //public const string CACHE_NAME_FORMAT_HTML_PAGE_CONTENT = "PageCachedContent[Cat:{0}_News:{1}_Page:{2}_DateSearch:{3}]";
        public const string CACHE_NAME_FORMAT_HTML_PAGE_CONTENT = "PageCachedContent_{7}[Cat:{0}_News:{1}_Page:{2}_DateSearch:{3}_tab{4}_san{5}_date{6}]";
        /// <summary>
        /// ControlCachedContent[{control_container_id}][Cat:{category}_News:{news}_Page:{page}]
        /// </summary>
        public const string CACHE_NAME_FORMAT_HTML_CONTROL_CONTENT = "ControlCachedContent[{0}][Cat:{1}_News:{2}_Page:{3}]";
        /// <summary>
        /// ControlCachedContent[Top10LastestNewsInCat:{category}]
        /// </summary>
        public const string CACHE_NAME_TOP_LASTEST_NEW_ID = "ControlCachedContent[TopLastestNewsInCat:{0}]";

        public const string CACHE_NAME_TOP_NEWS_ID = "TOP_NEWS_ID_{0}";
        /// <summary>
        /// {key}_LastUpdate
        /// </summary>
        public const string CACHE_NAME_LAST_UPDATE = "{0}_LastUpdate";
        /// <summary>
        /// {NewsID}_NewsDetail_Category
        /// </summary>
        public const string CACHE_NAME_NEWS_DETAIL_CATEGORY = "{0}_NewsDetail_Category";
        /// <summary>
        /// {NewsID}_NewsDetail_Title
        /// </summary>
        public const string CACHE_NAME_NEWS_DETAIL_TITLE = "{0}_NewsDetail_Title";
        /// <summary>
        /// {NewsID}_NewsDetail_Sapo
        /// </summary>
        public const string CACHE_NAME_NEWS_DETAIL_SAPO = "{0}_NewsDetail_Sapo";
        /// <summary>
        /// {NewsID}_NewsDetail_LogScript
        /// </summary>
        public const string CACHE_NAME_NEWS_DETAIL_LOG_SCRIPT = "{0}_NewsDetail_LogScript";
        /// <summary>
        /// DataCached_{CacheName}
        /// </summary>
        public const string CACHE_NAME_FORMAT_DATA_CACHE = "DataCached_{0}";

        public static string Channel = System.Configuration.ConfigurationManager.AppSettings["Channel"].ToString();
        public static string Ext = System.Configuration.ConfigurationManager.AppSettings["Ext"].ToString();
        public static string DomainImage = System.Configuration.ConfigurationManager.AppSettings["DomainImage"].ToString();
        public static string DomainName = System.Configuration.ConfigurationManager.AppSettings["DomainName"].ToString();

        #region Special parent category
        /// <summary>
        /// Parent Category sử dụng cho các control trong trang News Detail 
        /// </summary>
        public const string PARENT_CATEGORY_FOR_NEWS_DETAIL_CACHE = "-1";
        /// <summary>
        /// Parent Category sử dụng cho Data cache
        /// </summary>
        public const string PARENT_CATEGORY_FOR_DATA_CACHE = "-2";
        /// <summary>
        /// Parent Category sử dụng cho Homepage
        /// </summary>
        public const string PARENT_CATEGORY_FOR_HOME_PAGE_CACHE = "0";

        /// <summary>
        /// Parent Category sử dụng cho Portfolio cache
        /// </summary>
        public const string PORTFOLIO_FOR_DATA_CACHE = "8888";

        public const string THONGKE_FOR_DATA_CACHE = "9999";

        //screener
        public const string SCREENER_CACHE = "9999";
        /// <summary>
        /// Thoi gian luu cache cho Portfolio
        /// </summary>

        public const long THONGKE_TIME_FOR_DATA_CACHE = 864000;

        public const long PORTFOLIO_TIME_FOR_DATA_CACHE = 864000;

        public const long TIME_FOR_SCREENER_CACHE = 864000;
        #endregion
    }
}
